import re
import os, errno
import functools
import subprocess
import numpy as np
import pandas as pd
from plotnine import *
from pandas_plink import read_plink
from warnings import filterwarnings
from matplotlib.cbook import mplDeprecation
from scipy.stats import fisher_exact, binom_test
filterwarnings("ignore",category=mplDeprecation)
filterwarnings('ignore', category=UserWarning, module='plotnine.*')
filterwarnings('ignore', category=DeprecationWarning, module='plotnine.*')
config = {
'biomart_file': '../../../eQTL_analysis/caudate_eqtl/residualized_expression/plot_eqtls/_h/biomart.csv',
'phenotype_file': '../../../../inputs/antipsychotics_phenotypes/_m/merged_phenotypes.csv',
'plink_file_prefix': '../../../../inputs/genotypes/to_brnum/phase3_plink/_m/phase3',
'gwas_snp_file': '../../../../inputs/gwas/PGC2_CLOZUK/map_phase3/_m/libd_hg38_pggc2sz_snps.tsv'
}
@functools.lru_cache()
def get_de_df():
de_df = pd.read_csv(config_feature['de_file'], sep='\t', index_col=0)
return de_df
@functools.lru_cache()
def get_eqtl_df(fdr=0.05):
with subprocess.Popen('''awk ' ($6<%f) || (NR==1) {print}' %s ''' %
(fdr, config_feature['matrixeqtl_output_file']),
shell=True, stdout=subprocess.PIPE) as p:
eqtl_df = pd.read_csv(p.stdout, sep='\t')
return eqtl_df
@functools.lru_cache()
def get_gwas_snps():
return pd.read_csv(config['gwas_snp_file'], sep='\t', index_col=0, low_memory=False)
@functools.lru_cache()
def get_integration_df(fdr=0.05):
dft = get_gwas_snps().merge(get_eqtl_df(fdr), left_on='our_snp_id', right_on='SNP',
suffixes=['_PGC2', '_eqtl'])\
.merge(get_de_df(), left_on='gene', right_index=True)
return dft
@functools.lru_cache()
def get_residual_expression_df():
residual_expression_df = pd.read_csv(config_feature['residual_expression_file'],
sep='\t', index_col=0).transpose()
return residual_expression_df
@functools.lru_cache()
def get_pheno_df():
pheno_df = pd.read_csv(config['phenotype_file'], index_col=0)
pheno_df['New_Dx'] = pheno_df.New_Dx.astype('category')\
.cat.reorder_categories(['Control', 'Schizo_noAP', 'Schizo_AP'])
return pheno_df
def agree_direction(row):
return [-1, 1][row['pgc2_a1_same_as_our_counted']] * np.sign(row['OR'] - 1) * np.sign(row['t-stat']) * np.sign(row['t'])
def letter_snp(number, a0, a1):
'''
Example:
letter_snp(0, 'A', 'G') is 'AA'
letter_snp(1, 'A', 'G') is 'AG'
letter_snp(2, 'A', 'G') is 'GG'
'''
if np.isnan(number):
return np.nan
if len(a0)==1 and len(a1)==1:
sep = ''
else:
sep = ' '
return sep.join(sorted([a0]*int(number) + [a1]*(2-int(number))))
def get_gwas_snp(snp_id):
gwas = get_gwas_snps()
r = gwas[gwas['our_snp_id']==snp_id]
assert len(r) == 1
return r
@functools.lru_cache()
def get_expression_and_pheno_df():
return pd.merge(get_pheno_df(), get_residual_expression_df(), left_index=True, right_index=True)
@functools.lru_cache()
def get_plink_tuple():
'''
Usage: (bim, fam, bed) = get_plink_tuple()
'''
return read_plink(config['plink_file_prefix'])
@functools.lru_cache()
def get_snp_df(snp_id):
'''
Returns a dataframe containing the genotype on snp snp_id.
The allele count is the same as in the plink files.
Example:
get_snp_df('rs653953').head(5)
rs653953_num rs653953_letter rs653953
Br5168 0 GG 0\nGG
Br2582 1 AG 1\nAG
Br2378 1 AG 1\nAG
Br5155 2 AA 2\nAA
Br5182 2 AA 2\nAA
'''
(bim, fam, bed) = get_plink_tuple()
brain_ids = list(set(get_expression_and_pheno_df()['BrNum']).intersection(set(fam['fid'])))
snp_info = bim[bim['snp']==snp_id]
snp_pos = snp_info.iloc[0]['i']
fam_pos = list(fam.set_index('fid').loc[brain_ids]['i'])
dfsnp = (pd.DataFrame(bed[[snp_pos]].compute()[:,fam_pos], columns=brain_ids, index=[snp_id + '_num'])
.transpose().dropna())
my_letter_snp = functools.partial(letter_snp, a0=snp_info.iloc[0]['a0'], a1=snp_info.iloc[0]['a1'])
# the 2 - in next line is to workaround a possible bug in pandas_plink? a1 and a0 inverted
dfsnp[[snp_id + '_num']] = 2 - dfsnp[[snp_id + '_num']].astype('int')
dfsnp[snp_id + '_letter'] = dfsnp[snp_id + '_num'].apply(my_letter_snp)
dfsnp[snp_id] = (dfsnp[snp_id + '_num'].astype('str') + '\n' +
dfsnp[snp_id + '_letter'].astype('str')).astype('category')
return dfsnp
@functools.lru_cache()
def get_gwas_ordered_snp_df(snp_id):
'''
Returns a dataframe containing the genotype on snp snp_id.
The allele count is the number of risk alleles according to GWAS.
Example:
get_gwas_ordered_snp_df('rs653953').head(5)
rs653953_num rs653953_letter rs653953
Br5168 2 GG 2\nGG
Br2582 1 AG 1\nAG
Br2378 1 AG 1\nAG
Br5155 0 AA 0\nAA
Br5182 0 AA 0\nAA
'''
pgc = get_gwas_snps()
dfsnp = get_snp_df(snp_id).copy()
gwas_snp = get_gwas_snp(snp_id)
if gwas_snp['pgc2_a1_same_as_our_counted'].iloc[0]:
if gwas_snp['OR'].iloc[0] > 1:
pass
else:
dfsnp[[snp_id + '_num']] = 2 - dfsnp[[snp_id + '_num']]
else:
if gwas_snp['OR'].iloc[0] > 1:
dfsnp[[snp_id + '_num']] = 2 - dfsnp[[snp_id + '_num']]
else:
pass
dfsnp[snp_id] = (dfsnp[snp_id + '_num'].astype('str') + '\n' +
dfsnp[snp_id + '_letter'].astype('str')).astype('category')
return dfsnp
@functools.lru_cache()
def get_biomart_df():
biomart = pd.read_csv(config['biomart_file'])
biomart['description'] = biomart['description'].str.replace('\[Source.*$','')
return biomart
@functools.lru_cache()
def get_risk_allele(snp_id):
gwas_snp = get_gwas_snp(snp_id)
if gwas_snp['OR'].iloc[0] > 1:
ra = gwas_snp['A1'].iloc[0]
else:
ra = gwas_snp['A2'].iloc[0]
return ra
def get_gene_symbol(gene_id, biomart=get_biomart_df()):
ensge = re.sub('\..+$','', gene_id)
ggg = biomart[biomart['ensembl_gene_id']==ensge]
if ggg.shape[0]==0:
return '', ''
gs = ggg['external_gene_name'].values[0]
de = ggg['description'].values[0]
if type(de)!=str:
de = ''
de = re.sub('\[Source:.*$','',de)
return gs, de
def save_plot(p, fn):
for ext in ['png', 'pdf', 'svg']:
p.save(fn + '.' + ext)
def get_snp_gene_pheno_df(snp_id, gene_id, snp_df_func):
pheno_columns = list(get_pheno_df().columns)
expr_df = get_expression_and_pheno_df()[pheno_columns + [gene_id]]
snp_df = snp_df_func(snp_id)
return expr_df.merge(snp_df, left_on='BrNum', right_index=True)
def simple_snp_expression_pheno_plot_impl(snp_id, gene_id, snp_df_func, pheno_var):
df = get_snp_gene_pheno_df(snp_id, gene_id, snp_df_func)
df['Dx'] = df.Dx.astype('category').cat.rename_categories({'Control': 'CTL', 'Schizo': 'SZ'})
y0 = df[gene_id].quantile(.01) - 0.26
y1 = df[gene_id].quantile(.99) + 0.26
pjd = position_jitterdodge(jitter_width=0.27)
p = ggplot(df, aes(x=snp_id, y=gene_id, fill=pheno_var)) \
+ geom_boxplot(alpha=0.4, outlier_alpha=0) \
+ geom_jitter(position=pjd, stroke=0, alpha=0.6) + ylim(y0, y1) \
+ labs(y='Residualized expression', fill='Diagnosis') \
+ theme_matplotlib()\
+ theme(axis_text=element_text(size=18),
axis_title=element_text(size=21),
plot_title=element_text(size=22),
legend_text=element_text(size=14),
legend_title=element_text(size=16, face='bold'))
return p
def simple_gwas_ordered_snp_expression_pheno_plot(snp_id, gene_id, pheno_var):
return simple_snp_expression_pheno_plot_impl(snp_id, gene_id, get_gwas_ordered_snp_df, pheno_var)
def gwas_annotation(snp_id):
return 'SZ GWAS pvalue: %.1e' % get_gwas_snp(snp_id).iloc[0]['P']
def eqtl_annotation(snp_id, gene_id):
eqtl_df = get_eqtl_df()
r = eqtl_df[(eqtl_df['SNP']==snp_id) & (eqtl_df['gene']==gene_id)]
assert len(r)==1
return 'eQTL FDR: %.1e' % r.iloc[0]['FDR']
def de_annotation(gene_id):
de_df = get_de_df()
g = de_df[(de_df['gencodeID'] == gene_id)]
return 'DE adj.P.Val: %.3f' % g.iloc[0]['adj.P.Val']
def risk_allele_annotation(snp_id):
return 'SZ risk allele: %s' % get_risk_allele(snp_id)
def gwas_annotated_eqtl_pheno_plot(snp_id, gene_id, pheno_var):
p = simple_gwas_ordered_snp_expression_pheno_plot(snp_id, gene_id, pheno_var)
gene_symbol, gene_description = get_gene_symbol(gene_id)
title ="\n".join([gene_symbol, gene_id,
gwas_annotation(snp_id),
risk_allele_annotation(snp_id),
eqtl_annotation(snp_id, gene_id),
de_annotation(gene_id)])
p += ggtitle(title)
return p
config_feature = {
'de_file': '../../../differential_expression/_m/genes/diffExpr_szVctl_full.txt',
'residual_expression_file': '../../../differential_expression/_m/genes/residualized_expression.tsv',
'matrixeqtl_output_file': '../../../eQTL_analysis/caudate_eqtl/_m/cis_eqtls_genes.ctxt',
}
feature = 'genes'
try:
os.makedirs(feature)
except OSError as e:
if e.errno != errno.EEXIST:
raise
dft = get_integration_df()
dft.shape
/home/jbenja13/.local/lib/python3.8/site-packages/numpy/lib/arraysetops.py:580: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
(1739176, 44)
dft['agree_direction'] = dft.apply(agree_direction, axis=1)
agreement = {1: 'Yes', -1: 'No', 0: 0}
dft.agree_direction = [agreement[item] for item in dft['agree_direction']]
table = [[np.sum((dft['P']<5e-8) & ((dft['adj.P.Val']<.05))),
np.sum((dft['P']<5e-8) & ((dft['adj.P.Val']>=.05)))],
[np.sum((dft['P']>=5e-8) & ((dft['adj.P.Val']<.05))),
np.sum((dft['P']>=5e-8) & ((dft['adj.P.Val']>=.05)))]]
print(table)
fisher_exact(table)
[[3173, 31781], [202816, 1501406]]
(0.7390919085108425, 5.449845660955875e-63)
dft1 = dft[(dft['P']<5e-8) & ((dft['adj.P.Val']<.05))]
df = dft1.groupby('agree_direction').size().reset_index()
df
| agree_direction | 0 | |
|---|---|---|
| 0 | No | 687 |
| 1 | Yes | 2486 |
binom_test(df[0].iloc[1], df[0].sum())
2.9374167555820266e-237
dft2 = dft[(dft['P']<=5e-8)]
dft2 = dft2[(dft2['CtrlvsSZ'] != 0)]
dft2['risk_allele'] = dft2['our_snp_id'].apply(get_risk_allele)
direction = {-1: 'Down', 1: 'Up'}
boolean_conv = {True: 1, False: -1}
dft2.pgc2_a1_same_as_our_counted = [boolean_conv[item] for item in dft2['pgc2_a1_same_as_our_counted']]
dft2['eqtl_gwas_dir'] = [direction[item] for item in np.sign(dft2['pgc2_a1_same_as_our_counted']) * np.sign(dft2['t-stat']) * np.sign(dft2['OR'] - 1)]
dft2['de_dir'] = [direction[item] for item in np.sign(dft2['t'])]
dft2['eqtl_t'] = np.sign(dft2['pgc2_a1_same_as_our_counted']) * np.sign(dft2['OR'] - 1) * dft2['t-stat']
dft2 = dft2[['gene', 'Symbol', 'SNP_eqtl', 'A1', 'A2', 'risk_allele', 'OR',
'P', 'FDR', 'adj.P.Val', 'logFC', 't', 'eqtl_t',
'de_dir', 'eqtl_gwas_dir', 'agree_direction']]
dft2.to_csv('%s/integration_by_symbol.txt' % feature, sep='\t', index=False)
df2 = dft2.groupby(['gene']).first().reset_index().sort_values('P')
df2.groupby(['agree_direction']).size()
agree_direction No 23 Yes 23 dtype: int64
df2.set_index('Symbol').rename(columns={'t': 'de_t', 'P': 'GWAS_P', 'FDR': 'eQTL_FDR',
'adj.P.Val': 'de_adj.P.Val'})
| gene | SNP_eqtl | A1 | A2 | risk_allele | OR | GWAS_P | eQTL_FDR | de_adj.P.Val | logFC | de_t | eqtl_t | de_dir | eqtl_gwas_dir | agree_direction | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Symbol | |||||||||||||||
| ZSCAN9 | ENSG00000137185.11 | rs35501037:27739566:T:A | T | A | T | 1.259400 | 3.620000e-40 | 3.949424e-02 | 1.365665e-02 | -0.082397 | -3.337802 | -3.176934 | Down | Down | Yes |
| ZNF391 | ENSG00000124613.8 | rs67652222:27586220:C:T | C | T | C | 1.259200 | 5.190000e-40 | 1.176320e-02 | 4.140334e-02 | 0.074953 | 2.862466 | -3.597656 | Up | Down | No |
| HCG4 | ENSG00000176998.4 | rs3117425 | C | T | C | 1.261400 | 6.890000e-39 | 1.794875e-03 | 1.468069e-02 | 0.224649 | 3.307039 | 4.150195 | Up | Up | Yes |
| BRD2 | ENSG00000204256.12 | rs2395231:32637302:G:A | G | A | G | 1.219700 | 6.820000e-30 | 1.350959e-02 | 2.260331e-02 | -0.050859 | -3.130279 | -3.552720 | Down | Down | Yes |
| FLOT1 | ENSG00000137312.14 | rs3130665:30735979:C:T | C | T | C | 1.218400 | 1.100000e-29 | 4.112046e-02 | 2.923115e-02 | -0.044895 | -3.019341 | -3.161646 | Down | Down | Yes |
| C4A | ENSG00000244731.7 | rs3131642:31450637:G:A | G | A | G | 1.184600 | 2.080000e-28 | 5.615194e-09 | 2.714423e-03 | 0.392615 | 3.928587 | 6.786279 | Up | Up | Yes |
| PPP1R10 | ENSG00000204569.9 | rs3132649 | G | A | G | 1.220100 | 7.580000e-27 | 3.958557e-02 | 5.739890e-03 | -0.076713 | -3.666350 | 3.176081 | Down | Up | No |
| ZNF204P | ENSG00000204789.4 | rs12179134:27675469:A:G | A | G | A | 1.131700 | 1.580000e-22 | 2.159989e-02 | 1.394713e-02 | 0.097111 | 3.326268 | -3.395166 | Up | Down | No |
| ELFN1 | ENSG00000225968.7 | rs6461049 | C | T | T | 0.921190 | 1.870000e-17 | 1.432332e-02 | 4.832150e-02 | -0.119752 | -2.786812 | -3.533485 | Down | Down | Yes |
| EIF4E2 | ENSG00000135930.13 | rs10427328:233570204:T:C | T | C | T | 1.076400 | 4.950000e-14 | 4.510939e-02 | 4.840907e-02 | 0.030692 | 2.785840 | -3.126093 | Up | Down | No |
| BAG6 | ENSG00000204463.12 | rs6936825:31175044:T:C | T | C | C | 0.928720 | 2.610000e-13 | 3.564829e-02 | 1.906708e-02 | -0.041937 | -3.201790 | 3.215614 | Down | Up | No |
| CKB | ENSG00000166165.12 | rs373646693:104121939:ATTTTAT:A | A | ATTTTAT | A | 1.075730 | 4.457000e-13 | 4.702242e-02 | 5.822810e-03 | -0.082683 | -3.660539 | -3.109860 | Down | Down | Yes |
| NGEF | ENSG00000066248.14 | rs62193341:233708393:G:A | G | A | A | 0.917580 | 7.130000e-13 | 3.111085e-02 | 1.511964e-02 | 0.109010 | 3.294629 | -3.265640 | Up | Down | No |
| TDRD9 | ENSG00000156414.18 | rs10132641:104338258:A:G | A | G | A | 1.067600 | 5.650000e-11 | 1.891892e-02 | 3.651015e-02 | 0.156470 | 2.922234 | -3.440384 | Up | Down | No |
| AMBRA1 | ENSG00000110497.14 | rs7126343:46660623:T:C | T | C | C | 0.920450 | 8.610000e-11 | 2.639847e-02 | 1.340157e-03 | -0.053263 | -4.159326 | -3.324955 | Down | Down | Yes |
| DRD2 | ENSG00000149295.13 | rs7948028:113328681:A:C | A | C | A | 1.065800 | 3.690000e-10 | 4.209248e-02 | 6.265785e-03 | 0.118925 | 3.634433 | -3.152696 | Up | Down | No |
| NELFE | ENSG00000204356.12 | rs2844479 | A | C | C | 0.935320 | 4.400000e-10 | 3.276454e-02 | 1.841820e-02 | -0.048093 | -3.215519 | 3.246682 | Down | Up | No |
| PTN | ENSG00000105894.11 | rs7785663:137070298:G:A | G | A | G | 1.063700 | 5.530000e-10 | 4.939803e-02 | 1.314612e-02 | -0.085263 | -3.353056 | 3.090544 | Down | Up | No |
| CACNA1I | ENSG00000100346.17 | rs132585:39991496:G:A | G | A | G | 1.063300 | 6.530000e-10 | 1.244871e-02 | 3.017872e-02 | -0.096816 | -3.006159 | -3.579437 | Down | Down | Yes |
| CNNM2 | ENSG00000148842.17 | rs4919683 | C | A | C | 1.060400 | 1.120000e-09 | 3.783873e-08 | 2.810666e-03 | 0.056288 | 3.915991 | -6.453892 | Up | Down | No |
| PCCB | ENSG00000114054.13 | rs1278493 | G | A | A | 0.942680 | 1.210000e-09 | 3.214315e-15 | 4.270635e-02 | -0.056763 | -2.846921 | -8.962383 | Down | Down | Yes |
| CSDC2 | ENSG00000172346.14 | rs9611487:41460489:C:T | C | T | T | 0.938400 | 1.610000e-09 | 4.260842e-02 | 4.433705e-02 | 0.133225 | 2.829259 | 3.148082 | Up | Up | Yes |
| PLPP5 | ENSG00000147535.16 | rs9198:38120721:T:C | T | C | T | 1.069700 | 2.490000e-09 | 2.127392e-02 | 3.190042e-02 | -0.074217 | -2.981407 | -3.400386 | Down | Down | Yes |
| ME1 | ENSG00000065833.8 | rs12195417:84173028:T:C | T | C | C | 0.941170 | 3.090000e-09 | 2.544457e-02 | 2.086335e-05 | 0.120678 | 5.305498 | -3.337966 | Up | Down | No |
| TRMT61A | ENSG00000166166.12 | rs201836683:104008136:CAGG:C | CAGG | C | C | 0.938850 | 4.218000e-09 | 4.847909e-02 | 4.698102e-02 | -0.062775 | -2.799728 | -3.097942 | Down | Down | Yes |
| HIRIP3 | ENSG00000149929.15 | rs4787488 | A | C | A | 1.057900 | 4.590000e-09 | 8.377297e-03 | 4.350888e-04 | -0.086237 | -4.498828 | 3.704543 | Down | Up | No |
| ZC3H7B | ENSG00000100403.11 | rs9611522:41627924:C:T | C | T | T | 0.937550 | 5.740000e-09 | 2.088513e-02 | 1.190576e-02 | -0.057360 | -3.390946 | 3.406728 | Down | Up | No |
| PPTC7 | ENSG00000196850.5 | 12:110799944:A:G | A | G | A | 1.062800 | 7.370000e-09 | 8.237591e-03 | 1.215710e-03 | 0.098584 | 4.188957 | -3.709840 | Up | Down | No |
| TSNARE1 | ENSG00000171045.14 | rs72687339:143343145:C:T | C | T | C | 1.074000 | 1.150000e-08 | 1.228235e-02 | 3.418270e-03 | -0.079405 | -3.854472 | 3.583767 | Down | Up | No |
| PHF1 | ENSG00000112511.17 | rs3130018 | G | A | A | 0.945920 | 1.160000e-08 | 1.481843e-02 | 2.616096e-02 | -0.045084 | -3.068216 | -3.522265 | Down | Down | Yes |
| NRIP2 | ENSG00000053702.14 | rs10491964 | A | G | G | 0.941460 | 1.420000e-08 | 1.875899e-02 | 4.854494e-03 | -0.195818 | -3.728091 | -3.443278 | Down | Down | Yes |
| ENSA | ENSG00000143420.17 | rs12124898:150154352:C:T | C | T | T | 0.926970 | 1.430000e-08 | 3.993880e-03 | 1.703753e-02 | 0.045351 | 3.249546 | -3.926103 | Up | Down | No |
| KDM3B | ENSG00000120733.13 | rs7703010 | C | A | C | 1.056300 | 1.590000e-08 | 3.170122e-02 | 2.841025e-02 | -0.029358 | -3.031244 | -3.258763 | Down | Down | Yes |
| PPM1M | ENSG00000164088.17 | rs610060 | G | A | A | 0.947060 | 1.660000e-08 | 1.703614e-02 | 1.536149e-05 | -0.134830 | -5.376573 | -3.475793 | Down | Down | Yes |
| GRIN2A | ENSG00000183454.15 | rs9930307:9899226:C:G | C | G | G | 0.943860 | 1.830000e-08 | 1.299456e-02 | 3.804668e-04 | 0.166274 | 4.537293 | -3.565376 | Up | Down | No |
| REEP2 | ENSG00000132563.15 | rs10055995:137698299:C:T | C | T | C | 1.056000 | 1.860000e-08 | 3.690210e-06 | 6.375072e-09 | 0.140289 | 6.997511 | 5.584240 | Up | Up | Yes |
| PRRC2A | ENSG00000204469.12 | rs9266233:31325430:G:A | G | A | A | 0.943820 | 2.110000e-08 | 3.270178e-02 | 7.355771e-04 | -0.069114 | -4.340883 | 3.247424 | Down | Up | No |
| PLCL1 | ENSG00000115896.15 | rs4389332 | C | A | C | 1.055000 | 2.150000e-08 | 2.151444e-02 | 2.197220e-02 | -0.089394 | -3.141100 | 3.396518 | Down | Up | No |
| SREBF2 | ENSG00000198911.11 | rs5758487:42226395:C:T | C | T | C | 1.055300 | 2.290000e-08 | 3.258331e-03 | 6.387156e-04 | -0.079650 | -4.384469 | -3.984441 | Down | Down | Yes |
| IP6K3 | ENSG00000161896.11 | rs597723:33694079:C:T | C | T | C | 1.071700 | 2.460000e-08 | 2.805483e-03 | 1.618607e-03 | -0.244105 | -4.104238 | 4.026579 | Down | Up | No |
| LLGL1 | ENSG00000131899.10 | rs4925114 | A | G | A | 1.058200 | 2.640000e-08 | 4.701305e-02 | 1.327660e-02 | -0.098603 | -3.348813 | -3.109945 | Down | Down | Yes |
| NaN | ENSG00000228944.1 | rs79210963:24717969:T:C | T | C | C | 0.920640 | 3.510000e-08 | 2.030916e-02 | 2.431347e-02 | 0.276255 | 3.100551 | 3.416209 | Up | Up | Yes |
| PACSIN3 | ENSG00000165912.15 | rs59581888:46888001:T:TA | T | TA | TA | 0.912105 | 3.887000e-08 | 3.683547e-02 | 2.506271e-03 | -0.109838 | -3.954688 | 3.203371 | Down | Up | No |
| VRK2 | ENSG00000028116.16 | rs17815124:57991535:C:T | C | T | T | 0.913190 | 4.090000e-08 | 4.222191e-02 | 9.980042e-03 | -0.128897 | -3.457907 | 3.151540 | Down | Up | No |
| BNIP3L | ENSG00000104765.15 | rs1564576:26190836:C:G | C | G | G | 0.935950 | 4.270000e-08 | 1.612715e-02 | 1.877047e-02 | -0.059761 | -3.208755 | -3.494131 | Down | Down | Yes |
| ZNF14 | ENSG00000105708.8 | rs739461 | T | C | T | 1.061200 | 4.830000e-08 | 2.522662e-02 | 2.065108e-02 | 0.072821 | 3.167768 | 3.340966 | Up | Up | Yes |
for xx in range(df2.shape[0]):
gg = gwas_annotated_eqtl_pheno_plot(df2.iloc[xx, :].SNP_eqtl, df2.iloc[xx, :].gene, 'Dx')
print(gg)
label = '%s/eqtl_gwas_%s' % (feature, df2.iloc[xx, :].Symbol)
save_plot(gg, label)
Mapping files: 100%|██████████| 3/3 [00:13<00:00, 4.48s/it]
<ggplot: (8784198991737)>
<ggplot: (8783883785352)>
<ggplot: (8784194732960)>
<ggplot: (8783883459578)>
<ggplot: (8783904396837)>
<ggplot: (8783904477844)>
<ggplot: (8783883626150)>
<ggplot: (8783883626189)>
<ggplot: (8783883699999)>
<ggplot: (8783883473752)>
<ggplot: (8783883460877)>
<ggplot: (8783883504291)>
<ggplot: (8784198972203)>
<ggplot: (8784198946654)>
<ggplot: (8784198949970)>
<ggplot: (8783883519708)>
<ggplot: (8784198975112)>
<ggplot: (8783883753277)>
<ggplot: (8783883549681)>
<ggplot: (8783883683705)>
<ggplot: (8783904393436)>
<ggplot: (8784198958111)>
<ggplot: (8783883771751)>
<ggplot: (8784198975223)>
<ggplot: (8783883702794)>
<ggplot: (8783883682515)>
<ggplot: (8783904418265)>
<ggplot: (8783883420898)>
<ggplot: (8783875502779)>
<ggplot: (8783883417956)>
<ggplot: (8783883677290)>
<ggplot: (8783904454090)>
<ggplot: (8783883592409)>
<ggplot: (8783883538035)>
<ggplot: (8783875440845)>
<ggplot: (8784198989487)>
<ggplot: (8784198986262)>
<ggplot: (8783883519723)>
<ggplot: (8783883426250)>
<ggplot: (8783883486025)>
<ggplot: (8783875443664)>
<ggplot: (8783883621295)>
<ggplot: (8783883702935)>
<ggplot: (8783904497601)>
<ggplot: (8783875507333)>
<ggplot: (8784198964264)>